#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    : /counter.py
@Time    : 2021-05-19 14:39:21
@Author  : Gray Snail
@Version : 1.0
@Contact : shtao2011@sina.com
@License : Copyright (c) 2021 Gray Snail
@Desc    : 计数器
'''

# sleep 会造成 block

from time import sleep


def count_down(n):
    while n > 0:
        print('Down', n)
        sleep(1)
        n -= 1


def count_up(n):
    x = 0
    while x < n:
        print('Up', x + 1)
        sleep(1)
        x += 1


if __name__ == '__main__':
    count_down(5)
    count_up(20)
